﻿namespace Blaze.Editor.UI
{
    using Blaze.UI;
    using UnityEditor;
    using UnityEditor.UI;

    [CustomEditor(typeof (FastImage), true)]
    public class FastImageInspector : ImageEditor
    {
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            EditorGUILayout.Space();

            var fastImage = (FastImage) target;

            fastImage.IsAlphaSplitEnabled = EditorGUILayout.Toggle("AlphaSplit Enabled", fastImage.IsAlphaSplitEnabled);

            if (fastImage.IsAlphaSplitEnabled)
            {
                fastImage.IsAutoETC1Enabled = EditorGUILayout.Toggle("AutoEtc1 Enabled", fastImage.IsAutoETC1Enabled);
            }

            fastImage.IsMaskEnabled = EditorGUILayout.Toggle("Mask Enabled", fastImage.IsMaskEnabled);

            if (fastImage.type == UnityEngine.UI.Image.Type.Simple)
            {
                fastImage.IsPolygonEnabled = EditorGUILayout.Toggle("PolygonModel", fastImage.IsPolygonEnabled);
            }
        }
    }
}